package com.example.vehiclemanagesystem.service.Impl;

import com.example.vehiclemanagesystem.dao.DriverDao;
import com.example.vehiclemanagesystem.entity.Driver;
import com.example.vehiclemanagesystem.service.DriverService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DriverServiceImpl implements DriverService {
    @Autowired
    private  DriverDao driverDao;
    @Override
    public Driver selectDriverByDriverID(Integer d_id){
        return driverDao.selectDriverByDriverID(d_id);
    }
    @Override
    public void addNewDriver(Driver driver){
        driverDao.addNewDriver(driver);
    }
    @Override
    public void updateDriver(Driver driver){
        driverDao.updateDriver(driver);
    }
    @Override
    public void deleteDriver(Driver driver){
        driverDao.deleteDriver(driver);
    }
    @Override
    public List<Driver> allDriver(){return driverDao.allDriver();}
    @Override
    public List<Driver> findByPageF(int pageNum, int pageSize) {
        // TODO Auto-generated method stub
        PageHelper.startPage(pageNum, pageSize);
        List<Driver> lists = driverDao.allDriver();
        return lists;
    }


}
